let ul=document.querySelector('ul')
let load=document.querySelector('.loading')
let i=0
let line=1
function data(){
    for(;i<line*4;i++){
        let o=list[i]
        let li=document.createElement('li')
        for (const key in o) {          
            let s=`<img src='${list[i].pic}'/>
            <p>${list[i].name}</p>
            <p>城市: ${list[i].city}</p>
            <p>地址: ${list[i].address}</p>
            <p>价格: ${list[i].price}</p>
            <p>演出时间: ${list[i].showTime}</p>` 
            li.innerHTML=s          
        }
        ul.appendChild(li)
    }

}
data()
window.onscroll=()=>{
    if(document.documentElement.scrollTop+document.documentElement.offsetHeight
        >=document.documentElement.scrollHeight){
        if(line<8)data()
        else load.classList.add('active')  
        line++   
    }
}